package pro1.util;

public class NumberUtil {
	
	/**
	 * 向前移动一位小数点
	 * @param number
	 * @return
	 */
	private static double prePoint(double number){
		return Double.valueOf(String.valueOf(number).substring(0, String.valueOf(number).indexOf(".")-1)+"."+String.valueOf(number).substring(String.valueOf(number).indexOf(".")-1,String.valueOf(number).indexOf("."))+String.valueOf(number).substring(String.valueOf(number).indexOf(".")+1));
	}
	/**
	 * 向前移动小数点指定位数
	 * @param number
	 * @param index
	 * @return
	 */
	public static double prePoint(double number,int index){
		for(int i=0;i<index;++i){
			number=prePoint(number);
		}
		return number;
	}
}
